package com.zr.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zr.service.updateRoleServicecy;
import com.zr.serviceImpl.updateRoleServiceImplcy;

public class updateRoleControllercy extends HttpServlet{
	updateRoleServicecy p =new updateRoleServiceImplcy();
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
	doPost(req, resp);
}
@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		req.setCharacterEncoding("UTF-8");
		int UserName=Integer.parseInt(req.getParameter("UserName"));
		int UserRole=Integer.parseInt(req.getParameter("UserRole"));
		PrintWriter ps=resp.getWriter();
		boolean f=p.updateRole(UserName, UserRole);
	if(f){
		ps.write("1");
	}else{
		ps.write("0");
	}
	ps.flush();
	ps.close();
	}
}
